@isTest (SeeAllData=true)
private class Ann_Tsk_My_Controller_TestClass {   
   // Methods for testing 
    //enum PortalType { CSPLiteUser, PowerPartner, PowerCustomerSuccess, CustomerSuccess }
       
    static testmethod void usertest() {

        PageReference opptyPage = new PageReference('/apex/Ann_Task_List');
        system.Test.setCurrentPage(opptyPage);
        Ann_Tsk_My_Controller controller = new Ann_Tsk_My_Controller();

        Announcement__c Ann_c = new Announcement__c();
        Ann_c.Name = 'Ann_ABC';
        insert Ann_c;
      
        A_Task__c AnnTask_c = new A_Task__c();
        AnnTask_c.Name ='Atask_ABC';
        AnnTask_c.Announcement__c = Ann_c.Id;
        insert AnnTask_c;
      
        Account Acount = new Account(name='Acc_ABC');
        insert Acount;
      
        Contact contact1 = new Contact();
        contact1.LastName = 'lastname1';
        contact1.Firstname = 'firstname1';
        contact1.email = 'elias.almanza@softtek.com';
        contact1.AccountId= Acount.Id;
        insert contact1;
      
        Profile p = [SELECT Id FROM Profile WHERE Name='Custom - Portal Employee']; 
        User Usr = new User(Alias = 'empltest', Email='elias.almanza@softtek.com', 
        EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
        LocaleSidKey='en_US', ProfileId = p.Id,  CurrencyIsoCode='USD', 
        TimeZoneSidKey='America/Los_Angeles', UserName='employeetest@softtek.com', ContactId=contact1.Id);
        Usr.ContactId = contact1.Id; 
        insert Usr;
      
        
        A_Task_User__c AnnTskUsr_c = new A_Task_User__c();
        AnnTskUsr_c.Announcement_Task__c = AnnTask_c.Id;
        AnnTskUsr_c.User__c = Usr.Id;
        insert AnnTskUsr_c;
       
        System.RunAs(Usr) {
            
            
            controller.geta_tasks();
            
            controller.processRequests();
            controller.Filtro = '';
            controller.geta_tasks();
            controller.processRequests();            
            controller.getMyUserId();
            controller.getTsk_u();
            
            /*  System.assert([select isPortalEnabled
                               from user
                              where id = :UserInfo.getUserId()].isPortalEnabled,
                            'User wasnt portal enabled within the runas block. ');
            */
          }
          controller.save();
      }
       
   
  
    
    
  

}